﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<OrderViewModel>" MasterPageFile="~/Areas/Website/Views/Shared/Product.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<form action="<%=Url.Action("AddToOrder","Customer",null) %>" name="previewOrderForm" method="post">
    <div class="lc">
        <table class="v1">
            <thead>
                <tr class="title">
                    <td colspan="4">
                        订单预览
                    </td>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="textRight width80">
                        总件数:
                    </td>
                    <td>
                        <%= Model.OrderView.Count %>
                    </td>
                    <td class="textRight width80">
                        总金额
                    </td>
                    <td class="colorRed fontBold">
                        <%= Model.OrderView.Price.ToString("0.00") %>
                    </td>
                </tr>
            </tbody>
        </table>
        <table class="v2">
            <thead>
                <tr class="title" style="text-align: center;">
                    <td class="textLeft">
                        商品名称
                    </td>
                    <td>
                        数量
                    </td>
                    <td>
                        零售价
                    </td>
                    <td>
                        折扣率
                    </td>
                    <td>
                        折扣价
                    </td>
                    <td>
                        合计
                    </td>
                </tr>
            </thead>
            <tbody class="textCenter">
                <% foreach (var item in Model.ProductList)
                   {
                %>
                <tr>
                    <td class="textLeft">
                        <%=Html.ActionLink(item.ProductName, "PreView", "Product", new { ProductId = item.ProductId }, new { target="_blank"})%>
                        <span class="font12 colorGray">
                            <%= item.Description.Replace("\n","&nbsp;") %></span>
                    </td>
                    <td>
                        <input type="hidden" id="description_<%=item.ProductId %>" name="description" value="<%=item.Description %>" />
                        <input type="hidden" id="property_<%=item.ProductId  %>" name="property" value="<%=item.Property %>" />
                        <%=item.SalesCount %>
                        <%--<input type="text" id="SalesCount_<%=item.ProductId %>" name="SalesCount" value="<%=item.SalesCount %>" style="width:40px;" />--%>
                    </td>
                    <td>
                        <%= item.Price.ToString("0.00") %>
                    </td>
                    <td>
                        <%= item.DisCount.ToString("0.00") %>
                    </td>
                    <td>
                        <%= ((decimal)item.DisCount * item.Price).ToString("0.00") %>
                    </td>
                    <td>
                        <%= (item.SalesCount * (decimal)item.DisCount * item.Price).ToString("0.00") %>
                    </td>
                </tr>
                <%   
                   } 
                %>
            </tbody>
        </table>
        <table class="v3">
            <thead>
                <tr class="title">
                    <td colspan="2">
                        收货地址
                    </td>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <input type="hidden" id="addressId" name="addressId" value="0" />
                        <ul class="addressUl">
                            <%
                                int i = 0;
                              foreach (UserAddressEntity address in Model.AddressList)
                              {
                            %>
                            <li>
                                <input type="radio" id="address_<%= address.AddressId%>" name="address" <%=(i==0?"checked='checked'":"") %> value="<%=address.AddressId %>" />
                                <%= address.Address%>
                                <%=address.ReallyName%>
                                <%= address.PostNo%>
                                <%= address.Phone%>
                                <%= address.Mobile%>
                            </li>
                            <%
                                  i++;
                                } 
                              %>
                            <li>
                            <%--<input type="button" id="btnAddAddress" name="btnAddAddress" value="新增收货地址" />--%>
                                <a target="_blank" href="<%=Url.Action("AddressBook","Customer",null) %>">新增收货地址</a>
                            </li>
                        </ul>
                    </td>
                </tr>
            </tbody>
        </table>
        <table class="v4">
            <thead>
                <tr class="title">
                    <td colspan="2">
                        其它
                    </td>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="width80 textRight">
                        留言:
                    </td>
                    <td>
                        <textarea id="message" name="message" cols="50" rows="5"></textarea>
                    </td>
                </tr>
            </tbody>
        </table>
        <div class="sub">
            <input type="button" id="btnSubmit" name="btnSubmit" value="确认无误,提交" />
        </div>
    </div>
    <br />
    </form>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cssLink" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="jsLink" runat="server">
    <script type="text/javascript" src="<%=Url.Content("~/Scripts/Website/OrderPreview.js") %>"></script>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cssContent" runat="server">
    <style type="text/css">
        .lc
        {
            margin: auto;
        }
        .lc table
        {
            border-collapse: collapse;
            background-color: #fff;
            border: solid 1px #A2CBFF;
            border-bottom-width: 0px;
            width: 100%;
        }
        .lc table td
        {
            overflow: hidden;
            padding: 5px;
            vertical-align: middle;
            border-bottom: solid 1px #A2CBFF;
            line-height: 1.5em;
        }
        .lc table tr.title
        {
            background-color: #C6D9F0;
        }
        .addressUl li, .expressUl li
        {
            margin-top: 8px;
        }
        .sub
        {
            padding: 10px 0 10px 300px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="jsContent" runat="server">
    <script type="text/javascript">
        var updateCarUrl = "<%=Url.Action("UpdateCart","Customer",null) %>";
    </script>
</asp:Content>
